
package cn.knowimage.controller;

import cn.knowimage.pojo.Audit_Info;
import cn.knowimage.service.Audit_InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class Audit_InfoController {

	@Autowired
	public Audit_InfoService audit_InfoService;

	//对表audit_info进行所有的查询操作
	@RequestMapping("/audit_info")
	public String audit_info(Model model){

		List<Audit_Info> audit_infoList = audit_InfoService.findAll();

		model.addAttribute("audit_infoList", audit_infoList);
		return "testdata";
	}

	//对audit_Info表施行插入操作
	@RequestMapping("/insertAudit_info")
	public String insertAudit_info(Audit_Info audit_Info) {
		audit_Info.setPathway_id(10);
		audit_Info.setPathway_name("小儿气管（支气管）异物");
		audit_Info.setSubmitter("chen");
		audit_Info.setChecker("Li");
		audit_Info.setAudit_state(0);
		int count = audit_InfoService.insertAudit_info(audit_Info);
		if(count == 1){
			return "ok";
		}else{
			return "false";
		}
	}

}


